package com.ibl.rover.lite.common.bean;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;

public class ProductCategroy extends BaseBean {

	@ColumnOrder(Order = 1)
	private String categoryCode;

	private static AutomatedQueryStatement AUTO_GEN_QUERY;

	public static final String COL_CATEGORY_CODE = "CATEGORY_CODE";

	public static final int IDX_COL_CATEGORY_CODE = 1;

	static {
		AUTO_GEN_QUERY = SQLiteDatabaseHelper
				.getAutoGeneratedStmts(ProductCategroy.class);
	}

	@Override
	public void bind(SQLiteStatement sqlLiteStatement) {
		sqlLiteStatement.bindString(IDX_COL_CATEGORY_CODE, getCategoryCode());

	}

	@Override
	public <T extends BaseBean> T cursorBind(Cursor cursor) {
		ProductCategroy productCategroy = new ProductCategroy();
		productCategroy.set_id(cursor.getInt(IDX_COL_ID));
		productCategroy
				.setCategoryCode(cursor.getString(IDX_COL_CATEGORY_CODE));

		return (T) productCategroy;
	}

	@Override
	public <T extends BaseBean> T cursorInit(Cursor cursor) {
		this.set_id(cursor.getInt(IDX_COL_ID));
		this.setCategoryCode(cursor.getString(IDX_COL_CATEGORY_CODE));

		return (T) this;
	}

	@Override
	public String getCreateTableQuery() {
		return AUTO_GEN_QUERY.getCreateTableQuery();
	}

	@Override
	public String getInsertQuery() {
		return AUTO_GEN_QUERY.getPreparedInsertQuery();
	}

	@Override
	public String getDeleteQuery() {
		return AUTO_GEN_QUERY.getPreparedDeleteQuery();
	}

	@Override
	public String getUpdateQuery() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getTableName() {
		return AUTO_GEN_QUERY.getTableName();
	}

	public String getCategoryCode() {
		return categoryCode;
	}

	public void setCategoryCode(String categoryCode) {
		this.categoryCode = categoryCode;
	}

	@Override
	public ContentValues bindContentValues() {
		// TODO Auto-generated method stub
		return null;
	}

}
